package com.atguigu.mq.listener;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MqListener {


    /*@RabbitListener(queues = {"atguigu.queue.simple"})
    public void handlerMessage(String msg, Message message, Channel channel){
        System.out.println("msg = " + msg);
        System.out.println("message = " + message);
    }


    @RabbitListener(queues = {"atguigu.queue.work"})
    public void handlerMessageWork1(String msg, Message message, Channel channel){
        System.out.println("Work1 msg = " + msg);
    }


    @RabbitListener(queues = {"atguigu.queue.work"})
    public void handlerMessageWork2(String msg, Message message, Channel channel){
        System.out.println("Work2 msg = " + msg);
    }



    @RabbitListener(queues = {"atguigu.queue.fanout01"})
    public void handlerMessageFanout01(String msg, Message message, Channel channel){
        System.out.println("Fanout01 msg = " + msg);
    }


    @RabbitListener(queues = {"atguigu.queue.fanout02"})
    public void handlerMessageFanout02(String msg, Message message, Channel channel){
        System.out.println("Fanout02 msg = " + msg);
    }



    @RabbitListener(queues = {"atguigu.queue.direct01"})
    public void handlerMessageDirect01(String msg, Message message, Channel channel){
        System.out.println("Direct01 msg = " + msg);
    }


    @RabbitListener(queues = {"atguigu.queue.direct02"})
    public void handlerMessageDirect02(String msg, Message message, Channel channel){
        System.out.println("Direct02 msg = " + msg);
    }



    @RabbitListener(queues = {"atguigu.queue.topic01"})
    public void handlerMessageTopic01(String msg, Message message, Channel channel){
        System.out.println("Topic01 msg = " + msg);
    }


    @RabbitListener(queues = {"atguigu.queue.topic02"})
    public void handlerMessageTopic02(String msg, Message message, Channel channel){
        System.out.println("Topic02 msg = " + msg);
    }*/
}
